<template>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="基础信息" name="first">
      <ViewForm v-if="activeName === 'first'" v-bind="$attrs" />
    </el-tab-pane>
    <el-tab-pane label="生命周期" name="second">
      <LifeCycle v-if="activeName === 'second'" :asset="$attrs.instance.code" />
    </el-tab-pane>
    <el-tab-pane v-if="$attrs.instance.belongs === 'kj' && $attrs.instance.categories !== '3'" label="配件" name="third">
      <PartsBindTable v-if="activeName === 'third'" :embedded="true" :asset="$attrs.instance" />
    </el-tab-pane>
  </el-tabs>
</template>
<script>
import ViewForm from './viewForm.vue'
import LifeCycle from './lifeCycle.vue'
import PartsBindTable from './partsBind.vue'
export default {
  name: 'AssetViewPage',
  components: {
    ViewForm,
    PartsBindTable,
    LifeCycle
  },
  data() {
    return {
      activeName: 'first'
    }
  },
  methods: {
    handleClick(tab, event) {
    }
  }
}
</script>
